<?php $this->load->view('inc/header.php');?><div class="w1" style="position: relative;overflow: hidden;">

<div class="b4"></div>

<div class="filterbar">
	<div class="fl c2 fb home-icon"><?php echo $member->nname;?></div>
	<div class="fr">主题数：<?php echo $topic_count;?></div>
	<div style="clear: both;"></div>
</div>

<div class="b2"></div>

<div id="topic-container">
	<div class="topic sd1">
		<div class="member-center">
			<div class="member-center-avatar">
				<a href="<?php echo site_url('c=member&m=index&id='.$member->id);?>">
					<img src="http://www.gravatar.com/avatar/<?php echo md5($member->email);?>?s=180&d=&r=X"/>
				</a>
			</div>
			<div class="member-center-nname">
				<div class="c2 fs1 fb"><?php echo $member->nname;?></div>
			</div>
			
			<div class="member-center-info">
				<div class="c3 fs2"><?php echo $member->pslinfo;?></div>
			</div>
			<?php if(!$is_self):?>
			<div class="member-center-opt">
				<a class="btn-follow-1 btn-ajax <?php echo ($is_followed) ? 'followed' : '';?>" 
					afterdo="follow_afterdo" befordo="follow_befordo" 
					href="<?php echo site_url('c=member&m=follow&id='.$member->id);?>"
				>
					<?php echo ($is_followed) ? '已' : '';?>关注
				</a>
			</div>
			<?php endif;?>
		</div>
	</div>
	<?php $this->load->view('topic/inc_topic_item.php');?>
</div>

<?php echo $pagelinks;?>


</div><?php $this->load->view('inc/footer.php');?>
<script>
function follow_afterdo(msg,$elt){

	if(msg.status == 'followed'){
		$elt.addClass('followed');
		$elt.html('').html('已关注');
	}else if(msg.status == 'unfollowed'){
		$elt.removeClass('followed');
		$elt.html('').html('关注');
	}else if(msg.status == 'unlogin'){
		$('#btn-login').click();
	}
	
	return false;
}

function follow_befordo($elt){

	if($elt.hasClass('followed')){
	　	asyncbox.confirm('Sure 不 Sure ?','警告',function(action){
			if(action == 'ok'){
				$elt.addClass('go');				
				$elt.click();
		　　}
		});
		
		if($elt.hasClass('go')){
			$elt.removeClass('go')
			return true;
		}else{
			return false;
		}
	}

	return true;
}
</script>
